﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Interpreter.TableBuilder
{
	internal class GenericTableBuilder
	{
		/*
		 * [0] - Class ID
		 * [1] - code location
		 * [2] - number of arguments
		 * [3+] - each pair after this point is a function argument
		 * 
		 * Args
		 * [2*n + 3] - arg n - name index
		 * [2*n + 4] - arg n - parameter ID if default value present, or 0
		 */
		public static int[][] GetTable(string rawString)
		{
			return Util.DoubleSplit(rawString, '`', '|', true);
		}

		public static int[][] GetTableWithoutDummyFirstEntry(string rawString)
		{
			return Util.DoubleSplit(rawString, '`', '|', false);
		}
	}
}
